import { translationMap } from "@/api/interface/sysManage/translation";
import { PORT1 } from "@/api/config/servicePort";
import http from "@/api";






// 初始化公司、部门、岗位


// flag=all  获取全部
export const getInitOrgsApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/orgs/all-orgs`, params, { cancel: false });
};

// 组织架构


//#region 获取组织架构图
export const getOrgsMapApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/orgs/map?get_auth=1&&auth_name=framework`, params, { cancel: false });
};

//获取组织架构概览


export const getOrgsMapListHeadApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/orgs/map-list-field`, params, { cancel: false });
};
export const getOrgsMapListApi = (params: FormData) => {
    return http.post(PORT1+`/personnel/orgs/map-list?get_auth=1&auth_name=overview`, params, { cancel: false });
};



//#region 公司部门
export const getDepHeadApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/orgs/dep-field`, params, { cancel: false });
};

//获取公司列表
export const getOrgsListApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/orgs/get-orgs`, params,  { cancel: false,loading: false  });
};

//获取部门表格头部


//公司、部门表格列表
export const getOrgsTableListApi = (params: FormData,name:string) => {
    return http.post(PORT1+`/personnel/orgs/list?get_auth=1&auth_name=${name}`, params,  { cancel: false,loading: false  });
};

//新增公司、部门
export const saveOrgsApi = (params: FormData) => {
    return http.post(PORT1+`/personnel/orgs/save`, params, { cancel: false });
};

//删除公司、部门
export const delOrgsApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/orgs/delete`, params, { cancel: false });
};


//#endregion

// =============================================================
//#region 岗位


//岗位列表
export const getOrgsStationTableListApi = (params: FormData) => {
    return http.post(PORT1+`/personnel/org-titles/list?get_auth=1&auth_name=postManagement`, params,  { cancel: false,loading: false  });
};

//新增/编辑岗位
export const saveOrgsStationApi = (params: FormData) => {
    return http.post(PORT1+`/personnel/org-titles/save`, params, { cancel: false });
};

//删除公司、部门
export const delOrgsStationApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/org-titles/delete`, params, { cancel: false });
};

//获取本部门下的岗位
export const getOrgDepTitleApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/org-titles/other-titles`, params, { cancel: false });
};

//合并保存接口
export const saveMergeApi = (params: FormData) => {
    return http.get(PORT1+`/personnel/org-titles/merge-titles`, params, { cancel: false });
};


//#endregion

  


  

